#include "StdAfx.h"
#include "Permutations.h"
#include <algorithm>

Permutations::Permutations(int wordLen = 1, int groupSize = 1): m_WordLen(wordLen), m_OriginalGroupSize(groupSize)
{
}

Permutations::~Permutations(void)
{
}

// the methods receives 2 int vectors and counts how many elements are in the intersection
#if 0
int Permutations::CountIntersection(vector<int> groupA, vector<int> groupB, int size)
{
	int intersectionSize = 0;
	sort(groupA.begin(),groupA.begin()+size);
	sort(groupB.begin(),groupB.begin()+size);
	int aCounter = 0;
	int bCounter = 0;
	while((aCounter != size) && (bCounter != size))
	{
		if (groupA[aCounter] == groupB[aCounter])
		{
			intersectionSize++;
			aCounter++;
			bCOunter++;
		}
		else if (groupA[aCounter] < groupB[aCounter])
		{
			aCounter++;
		}
		else
		{ 
			bCounter++;
		}
	}
	return intersectionSize;

}
#endif

int Permutations::GetGroupSize() const
{
	return m_OriginalGroupSize;
}
void Permutations::InsertPerm(const Permutation &perm)
{
	m_Permutations.push_back(perm);
}

